.number-container {
    position: relative;
    width: 500px;
    height: 50px;
    overflow: hidden;
    border: 1px solid #ccc;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
}

.number {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.number.old {
    animation: slide-up 0.3s ease-in-out forwards;
}

.number.new {
    transform: translateY(100%);
    animation: slide-up-new 0.3s ease-in-out forwards;
}

@keyframes slide-up {
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes slide-up-new {
    80% {
        transform: translateY(10px);
    }
    90% {
        transform: translateY(0);
    }
}
    